//
//  MainViewController.h
//  PhongThuyHuongNha
//
//  Created by Le Anh Tai on 9/28/13.
//  Copyright (c) 2013 Le Anh Tai. All rights reserved.
//

#import "BaseViewController.h"
#import "FlatDatePicker.h"
#import "PhongThuy/FengShuiCore.h"
#import "PhongThuy/HomeDirection.h"
#import <CoreLocation/CoreLocation.h>
#import "SevenSwitch.h"
#import "HeaderResultView.h"
#import "FooterResultView.h"
#import "OwnerInfoCalloutView.h"
#import "FooterResultView.h"

#define SECTION_HUONG_TOT 0
#define SECTION_HUONG_XAU 1

@interface MainViewController : BaseViewController<UITextFieldDelegate, FlatPickerDelegate, CLLocationManagerDelegate,UITableViewDataSource,UITableViewDelegate,OwnerInfoCalloutViewDelegate,UIWebViewDelegate,FooterResultViewDelegate>
{
    HomeDirection *_homeDirection;
    FengShuiCore *_fengShuiCore;        
    
    // Compass
    CLLocationManager *_locationManager;
    CLLocationCoordinate2D _currentLocation;
    CLLocationDirection _currentHeading;
    
    NSMutableArray *_huongInfos;
    
    OwnerInfoCalloutView *_ownerInfoCallout;
    HeaderResultView *_ownerInfoHeaderView;
    FooterResultView *_ownerInfoFooterView;
    
    UIView *_explainationView;
    
    UIWebView *_infoCompassWebView;
    
    CGFloat _preTouchX;
    
    BOOL _isAmLich;
}

@property (weak, nonatomic) IBOutlet UIView *headerView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;

@property (strong, nonatomic) IBOutlet UIView *ownerInfoView;
@property (strong, nonatomic) IBOutlet UIView *compassView;

@property (strong, nonatomic) IBOutlet UIScrollView *compassScrollView;

@property (strong, nonatomic) IBOutlet UIScrollView *batQuaiScrollView;
@property (strong, nonatomic) IBOutlet UIImageView *batQuaiImage;

@property (strong, nonatomic) IBOutlet UIView *footerView;
@property (strong, nonatomic) IBOutlet UILabel *footerLabel;


@property (weak, nonatomic) IBOutlet UILabel *ownerInfoTitleLabel;

@property (weak, nonatomic) IBOutlet UILabel *directionLabel;
@property (weak, nonatomic) IBOutlet UIButton *birthdayButton;

- (IBAction)birthDayButtonPressed:(id)sender;
- (IBAction)infoButtonPressed:(id)sender;
- (IBAction)infoCompassPressed:(id)sender;

- (void)updateBirthdayButton;
- (void)updateOwnerInfoCalloutToFengShuiCore;

- (void)addInfoCompassWebView;
- (void)showResult;

- (void)closeExplanationView;
- (void)reviewExplanationView;
- (void)removeInfoCompassWebView;

- (OwnerInfoCalloutView*)newOwnerInfoCalloutView;

- (void)updateBatQuaiImage:(NSString *)batQuaiImage;

@end
